<?php
$app->group('', function () {
    $this->get('/register[/{uid:[0-9]+}]', 'Controller\Main:register');//注册
    $this->get('/edit', 'Controller\Main:edit');//编辑
    $this->get('/index', 'Controller\Main:index');//首页
    $this->get('/sign', 'Controller\Main:sign');//每日签到
    $this->get('/activity', 'Controller\Main:activity');//活动
    $this->get('/activity_detail/{id:[0-9]+}', 'Controller\Main:activity_detail');//活动详情
    $this->get('/clothing', 'Controller\Main:clothing');//服装
    $this->get('/clothing_detail/{cid:[0-9]+}', 'Controller\Main:clothing_detail');//服装详情
    $this->get('/share', 'Controller\Main:share');//分享上传
    $this->get('/sharelist', 'Controller\Main:sharelist');//分享上传
    $this->any('/luck', 'Controller\Main:luck');//抽奖
    $this->any('/invitation', 'Controller\Main:invitation');//邀请
    $this->any('/event', 'Controller\Main:event');//事件消息
    $this->any('/redirect', 'Controller\Weichat:redirect');//授权后重定向的回调链接地址




});
$app->group('/admin', function () {
    $this->get('/login', 'Controller\User:index');//登陆
    $this->get('/loginout', 'Controller\User:loginout');//退出
    $this->get('/index', 'Controller\Admin:index');//首页
    $this->get('/user[/{data}]', 'Controller\Admin:user');//会员积分
    $this->get('/activity[/{data}]', 'Controller\Admin:activity');//活动报名
    $this->get('/clothing[/{data}]', 'Controller\Admin:clothing');//服装兑换
    $this->get('/share[/{data}]', 'Controller\Admin:share');//分享上传
    $this->get('/createactivity[/{act_id:[0-9]+}]', 'Controller\Admin:createactivity');//创建/编辑活动
    $this->get('/createclothing[/{cid:[0-9]+}]', 'Controller\Admin:createclothing');//创建/编辑服装
    $this->get('/downactivity/{act_id:[0-9]+}', 'Controller\Admin:downactivity');//下载报名参加活动的用户信息
    $this->get('/downuser', 'Controller\Admin:downuser');//下载会员信息
    $this->get('/downshare', 'Controller\Admin:downshare');//下载分享
    $this->get('/downclothing/{cid:[0-9]+}', 'Controller\Admin:downactivity');//下载兑换衣服的用户信息

});
//数据接口
$app->group('/api', function () {
    $this->post('/checklogin.json', 'Controller\AccountApi:checklogin');//登陆验证
    $this->any('/createaccount.json', 'Controller\AccountApi:createaccount');//创建后台账号
    $this->post('/createactivity.json', 'Controller\ActivityApi:createactivity');//创建活动
    $this->post('/createclothing.json', 'Controller\ClothingApi:createclothing');//创建服装
    $this->post('/deleteactivity.json', 'Controller\ActivityApi:deleteactivity');//删除活动
    $this->post('/uploadfile.json', 'Controller\FileApi:uploadfile');//上传图片
    $this->post('/saveuser.json', 'Controller\UserApi:saveuser');//上传图片
    $this->post('/saveshare.json', 'Controller\ShareApi:saveshare');//上传图片
    $this->post('/deleteclothing.json', 'Controller\ClothingApi:deleteclothing');//删除服装
    $this->post('/setting.json', 'Controller\SettingApi:setting');//设置
    $this->post('/getactivity.json', 'Controller\MainApi:getactivity');//活动列表
    $this->post('/getclothing.json', 'Controller\MainApi:getclothing');//服装列表
    $this->post('/getsharelist.json', 'Controller\MainApi:getsharelist');//上传记录
    $this->post('/doactivity.json', 'Controller\MainApi:doactivity');//报名参加活动
    $this->post('/doclothing.json', 'Controller\MainApi:doclothing');//服装兑换
    $this->post('/downimg.json', 'Controller\MainApi:downimg');//下载
    $this->post('/sendmsg.json', 'Controller\MsgApi:sendmsg');//短信
    $this->post('/register.json', 'Controller\MsgApi:register');//注册
    $this->post('/saveuserinfo.json', 'Controller\MsgApi:saveuserinfo');//修改用户信息
    $this->post('/dosign.json', 'Controller\MainApi:dosign');//签到
    $this->post('/doluck.json', 'Controller\MainApi:doluck');//抽奖
    $this->post('/deletechildren.json', 'Controller\MainApi:deletechildren');//删除宝宝
    $this->get('/doreceive.json', 'Controller\MainApi:doreceive');//1000积分兑换
});
?>